package daily.may0527;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class StreamCollectTest {
    public static void main(String[] args) {
        Integer[] array = {1, 3, 5, 7, 2, 4, 6};
        Stream<Integer> stream = Stream.of(array);
        //先排序，再将元素放到List集合
        List<Integer> list = stream.sorted()
                .collect(Collectors.toList());
        System.out.println(list);
    }
}
